Struct Result<TOk, TError>
Component result type.
Assembly: WaaS.Core.dll
public readonly struct Result<TOk, TError> : IEquatable<Result<TOk, TError>>
Implements:
System.IEquatable<WaaS.ComponentModel.Binding.Result
2>`
Properties
Ok
View Source
public TOk? Ok { get; }
Error
View Source
public TError? Error { get; }
Case
public Result<TOk, TError>.VariantCase Case { get; }
Methods
Equals(Result<TOk, TError>)
Indicates whether the current object is equal to another object of the same type.
View Source
public bool Equals(Result<TOk, TError> other)
Returns
System.Boolean
: true if the current object is equal to the <code class="paramref">other</code> parameter; otherwise, false.
Parameters
Type | Name | Description |
---|---|---|
WaaS.ComponentModel.Binding.Result<TOk, TError> | other | An object to compare with this object. |
Equals(object?)
Indicates whether this instance and a specified object are equal.
View Source
public override bool Equals(object? obj)
Returns
System.Boolean
: true if <code class="paramref">obj</code> and this instance are the same type and represent the same value; otherwise, false.
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current instance. |
GetHashCode()
Returns the hash code for this instance.
View Source
public override int GetHashCode()
Returns
System.Int32
: A 32-bit signed integer that is the hash code for this instance.### CreateOk(TOk)
public static Result<TOk, TError> CreateOk(TOk value)
Returns
WaaS.ComponentModel.Binding.Result<TOk, TError>
Parameters
Type | Name |
---|---|
<TOk> | value |
CreateError(TError)
public static Result<TOk, TError> CreateError(TError value)
Returns
WaaS.ComponentModel.Binding.Result<TOk, TError>
Parameters
Type | Name |
---|---|
<TError> | value |
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
System.String
: The fully qualified type name.
Implements
System.IEquatable<WaaS.ComponentModel.Binding.Result
2>`